fn main() {
    // 匹配Some
    let s = Option::Some(3);
    match s {
        Option::None => println!("None"),
        Option::Some(3) => {
            println!("some")
        }
        _ => (),
    }

    // 匹配None
    let _s2: Option<i32> = None;
    match _s2 {
        Option::None => println!("None"),
        Option::Some(3) => println!("some"),
        _ => (),
    }

    // _ 其他不想处理的
    let v: u8 = 3;
    match v {
        1 => println!("一"),
        3 => println!("三"),
        5 => println!("五"),
        _ => (),
    }

    // other 传值
    let rmb: RMB = RMB::Other(3);
    match rmb {
        RMB::OneYuan => {
            println!("one");
        }
        RMB::FiveYuan => {
            println!("five");
        }
        RMB::Other(other) => {
            println!("其他金额={:#?}", other);
        }
    }

    // if let
    let s3 = Some(3);
    if let Some(3) = s3 {
        println!("s3.three")
    }
}
#[allow(unused_variables)]
#[allow(dead_code)]
enum RMB {
    OneYuan,
    FiveYuan,
    Other(u8),
}
